package com.kws.system.service.payment.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kws.system.domain.payment.TbOrder;
import com.kws.system.domain.payment.info.QueryCommodityPayOrderInfo;
import com.kws.system.domain.payment.info.QueryServerOrderInfo;
import com.kws.system.domain.payment.rq.QueryCommodityPayOrderRq;
import com.kws.system.mapper.payment.OrderManagementMapper;
import com.kws.system.service.payment.OrderManagementService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <b>OrderManagementServiceImpl</b>
 *
 * @description: OrderManagementServiceImpl <br>
 * @date: 2024/11/22 11:54 <br>
 * @author: lhm <br>
 * @version: 1.0 <br>
 */

@Service
public class OrderManagementServiceImpl extends ServiceImpl<OrderManagementMapper, TbOrder> implements OrderManagementService {
    private static final Logger logger = LoggerFactory.getLogger(OrderManagementServiceImpl.class);


    @Override
    public Page<QueryCommodityPayOrderInfo> queryCommodityPayOrderPage(QueryCommodityPayOrderRq rq) {
        Page<QueryCommodityPayOrderInfo> page = new Page<>(rq.getPageNum(), rq.getPageSize());
        Page<QueryCommodityPayOrderInfo> pageInfo = baseMapper.queryCommodityPayOrderPage(page,rq);
        return pageInfo;
    }

    @Override
    public QueryCommodityPayOrderInfo queryCommodityPayOrderById(Long id) {
        return baseMapper.queryCommodityPayOrderById(id);
    }

    @Override
    public boolean refundOrder(Long id) {
        TbOrder tbOrder = baseMapper.selectById(id);

        return false;
    }

    @Override
    public Page<QueryServerOrderInfo> queryServerOrderPage(QueryCommodityPayOrderRq rq) {
        Page<QueryServerOrderInfo> page = new Page<>(rq.getPageNum(), rq.getPageSize());
        Page<QueryServerOrderInfo> pageInfo = baseMapper.queryServerOrderPage(page,rq);
        return pageInfo;
    }

    @Override
    public QueryServerOrderInfo queryServerOrderById(Long id) {
        return baseMapper.queryServerOrderById(id);
    }

    @Override
    public List<QueryServerOrderInfo> queryServerOrderList(Long id, Long itemId) {
        return baseMapper.queryServerOrderList(id,itemId);
    }
}
